package com.atguigu.dga.governance.controller;

import com.atguigu.dga.governance.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/governance")
public class MainGovernanceController {


    @Autowired
    GovernanceAssessTableService governanceAssessTableService;

    @Autowired
    GovernanceAssessGlobalService governanceAssessGlobalService;

    @Autowired
    GovernanceAssessDetailService governanceAssessDetailService;

    @Autowired
    GovernanceAssessTecOwnerService governanceAssessTecOwnerService;

    @Autowired
    MainAssessService mainAssessService;
    //重新评估
    @PostMapping("/assess/{date}")
    public void getAssess(@PathVariable("date") String date) throws Exception {
        mainAssessService.getAssessService(date);
    }

    //分组人员排行榜
    @GetMapping("/rankList")
    public String getRankList(){
        return governanceAssessTecOwnerService.getRankListService();
    }


    //各个治理类型的问题个数
    @GetMapping("/problemNum")
    public String getProblemNum(){
        return governanceAssessDetailService.getProblemNumService();
    }
    //问题列表分数接口
    @GetMapping("/problemList/{governType}/{pageNo}/{pageSize}")
    public String getProblemList(@PathVariable("governType") String governType,
                                 @PathVariable("pageNo") Integer pageNo,
                                 @PathVariable("pageSize") Integer pageSize){
        return governanceAssessDetailService.getProblemListService(governType,pageNo,pageSize);
    }
    //全局分数接口
    @GetMapping("/globalScore")
    public String getGlobalScore(){
       return governanceAssessGlobalService.getGlobalScoreGlobalService();
    }
}
